#ifndef XWIDGET_H
#define XWIDGET_H

#ifdef XEXPORTING
#define XEXPORT_DLL __declspec(dllexport)
#else
#define XEXPORT_DLL __declspec(dllimport)
#endif

#include <XDraw.h>
#include <XInput.h>
#include <XMain.h>

class XEXPORT_DLL XWidget
{
protected:
	XHash Hash;
	bool Enabled;
	XWindow* ParentWindow;
	XRectangle Rectangle;
	XRenderPack* Render;
	XTextPack* Text;

	virtual void _loadVertices();
	virtual void _loadTextureVertices() = 0;
public:
	XWidget(XHash hash, XWindow* parent);
	virtual ~XWidget();

	
	virtual void SetEnable();
	virtual void SetDisable();
	virtual void SetGeometry(XRectangle rect);
	bool IsMouseOver(XPosition pos);

	XRenderPack* GetRenderPack();
	XTextPack* GetTextPack();

	bool GetEnabled();
	XRectangle GetGeometry();

	virtual void Update(XInputModule* input) = 0;
};

#endif